#!/usr/bin/python
#-*- coding:utf-8 -*-  


def singleton(cls):
    instances = {}
    
    def getinstance(*args,**kwargs):
        if cls not in instances:
            instances[cls] = cls(*args,**kwargs)
        return instances[cls]

    return getinstance
    
@singleton
class SingletonTest:
    a = 1